<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/picker-common.js"></script>
<script src="../calendar-picker/resources/calendar-picker-common.js"></script>
</head>
<body>
<input type="time" id="time" value="14:15" min="10:12">
<script>

let t = async_test('Test select invalid min value in time popup');

function selectValue() {
  let timeElement = document.getElementById("time");
  timeElement.addEventListener("change", t.step_func_done(() => {
    assert_equals(timeElement.value, "06:16");
    assert_true(timeElement.validity.rangeUnderflow);
    assert_false(timeElement.validity.valid);
  }));
  clickTimeCellAt(0, 4);
  clickTimeCellAt(1, 1);
  clickTimeCellAt(2, 1);
  eventSender.keyDown('Enter');
}

t.step(() => {
  openPicker(document.getElementById('time'), t.step_func(selectValue));
});
</script>
</body>
</html>